package com.time.admin.common.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 邮件配置类
 *
 * @author: HuangQi
 * @date: Created in 16:59 2025/11/11
 * @description: 邮件配置类
 */
@Data
@Component
@ConfigurationProperties(prefix = "blog.admin.email")
public class EmailProperties {

    /**
     * 是否启用邮件发送
     */
    private Boolean enabled = false;

    /**
     * 默认发件人邮箱地址
     */
    private String defaultFrom;

    /**
     * SMTP 服务器配置
     */
    private Smtp smtp = new Smtp();

    @Data
    public static class Smtp {
        /**
         * SMTP 服务器地址
         */
        private String host;
        /**
         * SMTP 端口号
         */
        private Integer port = 587;
        /**
         * 登录用户名
         */
        private String username;
        /**
         * 登录密码或授权码
         */
        private String password;
        /**
         * 发件人显示名称
         */
        private String fromName;
        /**
         * 是否启用 SSL
         */
        private Boolean sslEnabled = false;
    }
}
